<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="LoanRescheduling.aspx.cs"
    MasterPageFile="~/MasterPages/Core.Master" Inherits="Pap.Web.Modules.Loan.Views.LoanRescheduling"
    meta:resourcekey="PageResource1" %>

<%@ Register Src="../../Shared/Views/InsertAttchments.ascx" TagName="InsertAttchments"
    TagPrefix="uc1" %>
<asp:Content runat="server" ContentPlaceHolderID="ContentPlaceHolder1">
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <ext:Store runat="server" ID="storeLoanInstallments">
        <Reader>
            <ext:JsonReader>
                <Fields>
                    <ext:RecordField Name="InstallmentDate" />
                    <ext:RecordField Name="OriginalInstallmentAmount" />
                    <ext:RecordField Name="InterestInstallmentAmount" />
                    <ext:RecordField Name="TotalInstallmentAmount" />
                </Fields>
            </ext:JsonReader>
        </Reader>
    </ext:Store>
    <ext:FitLayout runat="server" IDMode="Legacy" meta:resourcekey="FitLayoutResource1">
        <ext:Panel runat="server" AutoScroll="true">
            <Body>
                <ext:FormPanel runat="server" ID="mainPanel" IDMode="Static" Title="Rescheduling Data"
                    AutoHeight="true" AutoWidth="true" meta:resourcekey="mainPanelResource1">
                    <Body>
                        <ext:FormLayout ID="frmLay" IDMode="Static" runat="server" meta:resourcekey="FormLayoutResource1">
                            <ext:Anchor>
                                <ext:TextField runat="server" ID="txtLoanNumber" FieldLabel="LaonNumber" Disabled="True"
                                    meta:resourcekey="txtLoanNumberResource1" Text="" />
                            </ext:Anchor>
                            <ext:Anchor>
                                <ext:TextField runat="server" ID="txtCustomerName" FieldLabel="CustomerName" Disabled="True"
                                    meta:resourcekey="txtCustomerNameResource1" Text="" />
                            </ext:Anchor>
                            <ext:Anchor>
                                <ext:TextField runat="server" ID="txtBalanceToReschedule" FieldLabel="BalanceToReschedule"
                                    Disabled="True" meta:resourcekey="txtBalanceToRescheduleResource1" Text="" />
                            </ext:Anchor>
                            <ext:Anchor>
                                <ext:NumberField runat="server" ID="nufMonthCount" AllowNegative="False" AllowDecimals="false"
                                    MaxLength="10" MaxValue="2147483647" FieldLabel="MonthCount" MinValue="1" AllowBlank="False"
                                    meta:resourcekey="nufMonthCountResource1" />
                            </ext:Anchor>
                            <ext:Anchor>
                                <ext:DateField runat="server" ID="dateFirstInstallmentDate" AllowBlank="False" FieldLabel="FirstInstallmentDate"
                                    MaxDate="" meta:resourcekey="dateFirstInstallmentDateResource1" MinDate="" SelectedDate="" />
                            </ext:Anchor>
                            <ext:Anchor>
                                <ext:Button runat="server" ID="btnInstallmentTable" Icon="MagifierZoomOut" Text="InstallmentTable"
                                    CommandArgument="" CommandName="" meta:resourcekey="btnInstallmentTableResource1">
                                    <AjaxEvents>
                                        <Click OnEvent="BtnInstallmentTable_Clicked" Before="return Ext.getCmp('mainPanel').getForm().isValid();">
                                        </Click>
                                    </AjaxEvents>
                                </ext:Button>
                            </ext:Anchor>
                            <ext:Anchor>
                                <ext:Panel IDMode="Static" runat="server" Width="800" AutoHeight="true" ID="pnlAttachments">
                                    <Body>
                                        <uc1:InsertAttchments runat="server" ID="insertAttchment" ViewMode="Edit" />
                                    </Body>
                                </ext:Panel>
                            </ext:Anchor>
                        </ext:FormLayout>
                    </Body>
                    <BottomBar>
                        <ext:StatusBar runat="server" meta:resourcekey="StatusBarResource1">
                            <Items>
                                <ext:ToolbarSpacer runat="server" ID="tlbSp" IDMode="Static" />
                                <ext:Button runat="server" ID="btnSubmit" IDMode="Static" Text="Submit" Icon="Accept"
                                    meta:resourcekey="btnSubmitResource1">
                                    <AjaxEvents>
                                        <Click OnEvent="BtnSubmit_Clicked" Before="return Ext.getCmp('mainPanel').getForm().isValid();">
                                        </Click>
                                    </AjaxEvents>
                                </ext:Button>
                            </Items>
                        </ext:StatusBar>
                    </BottomBar>
                </ext:FormPanel>
            </Body>
        </ext:Panel>
    </ext:FitLayout>
    <ext:Window runat="server" ID="wndLoanExecutionInstallments" Modal="true" ShowOnLoad="false"
        Height="260" Width="600px" Title="<%$ Resources:wndInstallmentTitle %>" Collapsible="false"
        AutoScroll="true" CloseAction="Hide">
        <Body>
            <ext:FitLayout runat="server">
                <ext:GridPanel runat="server" IDMode="Static" ID="gridLoanInstallments" StoreID="storeLoanInstallments"
                    AutoHeight="true" AutoWidth="true">
                    <ColumnModel>
                        <Columns>
                            <ext:Column DataIndex="InstallmentDate" Header="<%$Resources:HeaderInstallmentDate %>">
                                <Renderer Fn="Ext.util.Format.dateRenderer('d/m/Y')" />
                            </ext:Column>
                            <ext:Column DataIndex="OriginalInstallmentAmount" Header="<%$Resources:HeaderOriginalInstallmentAmount %>" />
                            <ext:Column DataIndex="InterestInstallmentAmount" Header="<%$Resources:HeaderInterestInstallmentAmount %>" />
                            <ext:Column DataIndex="TotalInstallmentAmount" Header="<%$Resources:HeaderTotalInstallmentAmount %>" />
                        </Columns>
                    </ColumnModel>
                </ext:GridPanel>
            </ext:FitLayout>
        </Body>
        <BottomBar>
            <ext:StatusBar runat="server" ID="tlb" IDMode="Static">
                <Items>
                    <ext:ToolbarSpacer runat="server" ID="toolbarSP" IDMode="Static" />
                    <ext:Button runat="server" ID="btnPrint" Text="print">
                        <Listeners>
                            <Click />
                        </Listeners>
                    </ext:Button>
                </Items>
            </ext:StatusBar>
        </BottomBar>
    </ext:Window>
    <ext:Window runat="server" ID="wndInstallmentsPrint" Modal="true" ShowOnLoad="false"
        Width="550px" Height="480px" AutoScroll="true">
        <AutoLoad Mode="IFrame" ShowMask="True" ManuallyTriggered="True" PassParentSize="True" />
        <AjaxEvents>
            <Close OnEvent="wndInstallmentsPrint_Closed" />
        </AjaxEvents>
    </ext:Window>
</asp:Content>
